﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.Page
{
    public partial class Top : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.lbDate.Text = DateTime.Now.ToString("yyyy年MM月dd日");

                object obj = Session["username"];
                if (obj != null)
                {
                    lbUser.Text = Session["username"].ToString();
                }
                else
                {
                    string script = "<script type=\"text/javascript\">if (window.opener != null) { window.opener.location = \"Login.aspx\"; window.close(); } else if (window.top != window) { window.top.location = \"Login.aspx\"; } </script>";
                    ClientScript.RegisterClientScriptBlock(GetType(), "redirect", script, false);
                    //Response.Redirect(FormsAuthentication.LoginUrl);
                }
            }
        }
    }
}